import argparse
from file_operations import FileHandler
# 替换为你的飞书 Webhook URL
webhook_url = "https://open.feishu.cn/open-apis/bot/v2/hook/86bd9e6d-605d-4031-a27e-a347f5aaa3f9"
# 创建 FileHandler 实例
handler = FileHandler(webhook_url)
base_dir = "/var/services/homes/xuyi/"
target_dir = "/var/services/homes/xuyi/斑马AI-02-百科/"
current_class = "04.海洋科普课-穿越奇妙海底世界（全）"
# current_class = "斑马百科-机械"
def main(action):
    rename_path = base_dir + current_class
    if action == 'rename':
        handler.rename_files(rename_path)
    elif action == 'move':
        source_folder = base_dir + current_class
        target_folder = target_dir + current_class
        # 可指定移动文件数量，默认 2 个
        handler.move_files(source_folder, target_folder, num_files=2)
    else:
        print("不支持的操作")
if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="文件操作脚本")
    parser.add_argument('action', type=str, choices=['rename', 'move'], help='操作类型: rename 或 move')
    args = parser.parse_args()
    
    main(args.action)